package com.maiji.cloud.controller.shopingmall;

import com.maiji.cloud.controller.BaseController;
import com.maiji.cloud.entities.shopingmall.ShipmentsInfoEntity;
import com.maiji.cloud.entities.shopingmall.ShopingAddress;
import com.maiji.cloud.request.BaseDataReqDto;
import com.maiji.cloud.request.shopingmall.*;
import com.maiji.cloud.response.BaseDataResDto;
import com.maiji.cloud.response.BaseMetaResDto;
import com.maiji.cloud.response.BaseResDto;
import com.maiji.cloud.response.shopingmall.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/orderRefund")
@Api(tags = {"售后模块"})
public class OrderRefundController extends BaseController{

	  /**
     *  获取用户退款申请列表
     * @param baseDataReqDto
     * @return
     */
	@PostMapping("findAllOrderRefunds")
    @ApiOperation(value = "获取用户退款申请列表")
    public BaseMetaResDto<List<ShoppingOrderRefundResData>> findAllOrderRefunds (@RequestBody BaseDataReqDto<OrderRefundReqData> baseDataReqDto) {
    	return restTemplate.postForObject(REST_URL_SHOPINGMALL + "/capital/findAllOrderRefunds", baseDataReqDto, BaseMetaResDto.class);
    }

	  /**
     *  统计退款类型数量
     * @return
     */
	@GetMapping("findAllOrderRefundsTypeCount")
    @ApiOperation(value = "统计退款类型数量")
    public BaseDataResDto<Map<Integer, Integer>> findAllOrderRefundsTypeCount () {
    	return restTemplate.getForObject(REST_URL_SHOPINGMALL + "/capital/findAllOrderRefundsTypeCount", BaseDataResDto.class);
    }

}
